perm filename MIX000[MIX,SYS] blob sn#020805 filedate 1972-03-10 generic text, type T, neo UTF8
COMMENT ⊗   VALID 00003 PAGES 
RECORD PAGE   DESCRIPTION
 00001 00001
 00002 00002	TITLE	MIX
 00008 00003		Registers 0-7 and 15 are used to simulate MIX's
 00010 ENDMK
⊗;
TITLE	MIX

COMMENT	⊗

	The summary given below is out of date:  there are many more buttons.
A full description is in the write-up:   MIX.DOC

        This is a MIX simulator.  The MIX machine being simulated has
a  byte  size  of  64.   At  present,  this  machine has virtually no
automatic input/output facilities.  However, it  does  have  numerous
console buttons with the following effects:

        "START" or "S"-- Type the word `start' followed 4  !'s;  then
                return to button mode. (When operational, this button
                will initialize the timer and  the  program  counter,
then begin execution at location 0000)

        "GO"  or  "G"--  Type  the  word `go' followed by 4 !'s; then
                return to button mode. (When operational, this button
                will  read  a  card  into  0000-0015,  then  jump  to
                location 0000)

        "LOAD" or "L"-- Type the word `load' followed by 4 !'s;  then
                return to button mode. (When operational, this button
                will read a  card  into  0000-0015,  then  return  to
                button mode)

        "CONT"  or "C"-- Type the word `cont' followed by 4 !'s; then
                begin execution at the instruction pointed to by  the
                program counter.

        "HALT"  or  "H"--  Return  to  button  mode.  To halt while a
                program is being executed, type a carriage-return.

        "STEP" or "X"-- Execute a single instruction.

        "DISP" or "D"-- Show the contents of rA, rX, rJ, the time (in
                octal and in MIX cycles) shown by the timer, the base
                address of the simulated core positions (the  address
                of  location  0000  in  octal),  the  PDP-10 location
                pointed to by  the  program  counter,  and  the  most
                recent MIX instruction executed.

        "MEM"  or  "M"--  Prepare  to read in four decimal digits and
                then type the contents of that MIX location;  if  "X"
                is typed instead of four digits, then leave "M" mode.
                (i.e., you can get several locations  each  time  you
                press "MEM")

        "ZXT"-- Zero out the timer.

        "ZPC"-- Set the program counter to location 0000.

        MIX words are represented by PDP-10 words on  a  1-1  (into?)
basis according to the following table:

		PDP-10 bits	MIX byte
		 0- 5		sign (00=+, 40=-)
		 6-11		byte 1
		12-17		byte 2
		18-23		byte 3
		24-29		byte 4
		30-35		byte 5

        Overall, the major emphasis has been on reasonable speed, but
extreme  attention  to  details, with the idea that this would not be
used for actual operation of programs to any great degree, but  would
be  used to debug compilers, and so it is important to know when some
"undefined" operation occurs.  I suspect that tables could be used to
a  greater  advantage.  I also plan to write several more subroutines
so that the amount of PDP-10 memory used by the program is decreased.
I  also  think  that  there are several areas where the code could be
significantly improved, but it is probably not worth the  expenditure
of time at this point in the game.




				Peace,



					(CS236B--June 5, 1970)

	⊗
COMMENT	⊗	Registers 0-7 and 15 are used to simulate MIX's
		rA-rX and rJ.  Registers 10-13 are work registers.
		Register 14 contains the MIX word which is the
		present instruction.  Register 16 contains the
		overflow indicator and the comparison indicator
		(bits 0-3) and a program counter (pointing to
		the next PDP-10 word to be interpreted) in bits
		13-35.  Register 17 contains the push-down pointer.
	⊗

↓RA	←0
↓R1	←1
↓R2	←2
↓R3	←3
↓R4	←4
↓R5	←5
↓R6	←6
↓RX	←7
↓RJ	←15

↓INSTR	←14
↓FLAGS	←↓PC	←16
↓P	←17

↓OVFLAG	←1B18
↓GFLAG	←1B19
↓EFLAG	←1B20
↓LFLAG	←1B21
↓SIFLAG	←1B22

REL0:				;*RES* RELOCATED ZERO, FOR DEBUGGING
EXTIME:	0			; EXTIME CONTAINS THE NUMBER OF MIX
				; EXECUTE CYCLES SINCE OPERATION
				; BEGAN

MC0000:	BLOCK	=4000		; SIMULATED MIX WORDS

PDL:	BLOCK	40		; PUSH-DOWN LIST

	XALL			;DON'T PRINT TEXT OF MACRO EXPANSIONS
DEFINE ULIST1 {DONEIT←←0}	;*RES* prepare to turn off listing
DEFINE ULIST2 {IFE DONEIT, {DONEIT←←1↔XLIST}}  ;*RES* turn it off
;	The two macros above are used to control length of macro
;	generated code listing.  They are used in the following way:
;
;	ULIST2 is put in a suitable place in the definition of <macro>
;
;	ULIST1
;	<macro>
;	LIST